import junit.framework.TestCase; 

/**
 *
 * @author Adam
 */
public class LiczbaTest extends TestCase {
    
    
    public LiczbaTest(String testName) {
        super(testName);
    }
    
    @Override
    protected void setUp() throws Exception {
        super.setUp();
        
    }
    
    @Override
    protected void tearDown() throws Exception {
        super.tearDown();
       
    }

    /**
     * Test of zapis method, of class Liczba.
     */
    public void testZapisToBinary() throws Exception {
        int podstawa = 2;
        Liczba instance = new Liczba(3);
        String expResult = "11";
        String result = instance.zapis(podstawa);
        assertEquals(expResult, result);
        System.out.println("conversion to binary was successful");
        
    }
    
    public void testZapisToOctal() throws Exception {
        
        int podstawa = 8;
        Liczba instance = new Liczba(17);
        String expResult = "21";
        String result = instance.zapis(podstawa);
        assertTrue(Integer.parseInt(result) == 21);
        System.out.println("conversion to octal was successful");
        
    }
    
        public void testPodstawaTwoToSixteen() throws Exception {
        Liczba instance = new Liczba();
        assertNotNull(instance);
        System.out.println("Newly created object Liczba is not null");
        
    }   
        
        public void testFalseAssertion() throws Exception {
        int podstawa = 2;
        Liczba instance = new Liczba(3);
        String expResult = "11";
        String result = instance.zapis(podstawa);
        assertEquals(expResult, result);
        assertFalse(podstawa > 16 && podstawa < 2);
        System.out.println("It is false that podstawa is higher than 16 or lower than 2");
   
        }
}
